$(function () {
    $('#submit').click(function () {
        var mobile = $('#mobile').val();
        var psw = $('#psw').val();
        var psw1 = $('#psw1').val();
        var formData = new FormData();
        formData.append("mobile",mobile);
        formData.append("psw",psw);
        if (psw !== psw1){
            $.toast('密码不一致！');
        }
        else {
            $.ajax({
                url:'/cinema/updatepsw',
                type:'post',
                data:formData,
                contentType:false,
                processData:false,
                cache:false,
                success:function (data){
                    if (data.success){
                        $.toast('修改成功！');
                        setTimeout(1000*2);
                        window.location.href = "../html/login.html";
                    }else {
                        $.toast('没有此用户！');
                    }
                }
            })
        }

    })
});